/**   
 * Copyright © 2017 Fan_繁. All rights reserved.
 * 
 * @Title: EmpServiceImpl.java 
 * @Prject: anger
 * @Package: com.hzt.anger.service 
 * @Description: TODO
 * @author: ChuanHui   
 * @date: 2017年8月4日 下午9:54:50 
 * @version: V1.0   
 */
package com.hzt.anger.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hzt.anger.dao.EmpMapper;
import com.hzt.anger.entity.Emp;

/**
 * @ClassName: EmpServiceImpl
 * @Description: TODO
 * @author: ChuanHui
 * @date: 2017年8月4日 下午9:54:50
 */
@Service
public class EmpServiceImpl implements EmpService {

	@Autowired
	private EmpMapper empMapper;

	/*
	 * (non Javadoc)
	 * 
	 * @Title: getEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param i
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#getEmp(java.lang.Short)
	 */
	@Override
	public Emp getEmp(Short empno) {
		// TODO Auto-generated method stub
		return empMapper.selectByPrimaryKey(empno);
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: allEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param map
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#allEmp(java.util.Map)
	 */
	@Override
	public List<Emp> allEmp(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return empMapper.getEmlList(map);
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: saveEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param emp
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#saveEmp(com.hzt.anger.entity.Emp)
	 */
	@Override
	public int saveEmp(Emp emp) {
		// TODO Auto-generated method stub
		return empMapper.insertSelective(emp);
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: editEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param emp
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#editEmp(com.hzt.anger.entity.Emp)
	 */
	@Override
	public int editEmp(Emp emp) {
		// TODO Auto-generated method stub
		return empMapper.updateByPrimaryKeySelective(emp);
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: removeEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param empno
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#removeEmp(java.lang.Short)
	 */
	@Override
	public int removeEmp(Short empno) {
		// TODO Auto-generated method stub
		return empMapper.deleteByPrimaryKey(empno);
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: findEmp
	 * 
	 * @Description: TODO
	 * 
	 * @param empno
	 * 
	 * @return
	 * 
	 * @see com.hzt.anger.service.EmpService#findEmp(java.lang.Short)
	 */
	@Override
	public Emp findEmp(Short empno) {
		// TODO Auto-generated method stub
		return empMapper.selectByPrimaryKey(empno);
	}

}
